#ifndef MYSERIALPORT_H
#define MYSERIALPORT_H

#include <QObject>
#include <QDebug>
#include <QFile>
#include "CSerialPort.h"
#include "CSerialPortInfo.h"
#include "CSerialPortSettings.h"

//#define GPIO_485 "/sys/class/leds/rs485/brightness"

class MySerialPort : public QObject,public has_slots<>
{
    Q_OBJECT
public:
    MySerialPort(QString portName,const CSerialPortSettings & setting,QObject *parent = nullptr);
    ~MySerialPort();
    int init();

    int sendData(const QByteArray& buf);
private slots:
    void onReceive();
signals:
    void sgReceive(QByteArray buf);
private:
    CSerialPort* _sp;
    //QFile* _fd;
    int tx;
    int rx;

};

#endif // MYSERIALPORT_H
